package com.ss.android.wenda.a;

import android.view.View;
import android.view.ViewGroup;

import com.ss.android.action.b.ImpressionHelper;
import com.ss.android.action.b.FeedViewHolder;
import com.ss.android.article.browser.R;
import com.ss.android.topic.view.c;
import com.ss.android.wenda.c.d;
import com.ss.android.wenda.c.e;
import com.ss.android.wenda.c.g;
import com.ss.android.wenda.model.Answer;

public final class a extends c {
    public int c;
    public com.ss.android.wenda.model.response.a d;
    private int e;
    private i f;
    private String g;
    private String h;

    public a(String arg2, int arg3, String arg4, String arg5) {

        this.e = 0;
        this.e = arg3;
        this.g = arg2;
        this.f = i.a();
        android.support.design.a.isTextEmpty(arg4);
        this.h = arg5;
    }

    static int a(com.ss.android.wenda.a.a arg1) {
        return arg1.c;
    }

    static int a(com.ss.android.wenda.a.a arg0, int arg1) {
        arg0.c = arg1;
        return arg1;
    }

    public final com.ss.android.k.aa a(int arg10, ViewGroup arg11) {
        com.ss.android.k.aa v0;
        int v8 = R.id.bury_btn;
        int v7 = R.id.user_intro;
        int v6 = R.id.user_name;
        int v4 = R.id.user_avatar;
        switch(this.getItemViewType(arg10)) {
            case 0: {
                View v0_1 = android.support.design.a.b(arg11, R.layout.answer_list_item_top);
                com.ss.android.article.base.feature.detail2.config.a.b(v0_1);
                v0 = new com.ss.android.k.aa(v0_1).a(v4, new com.ss.android.wenda.c.c(this.e, this.f))
                        .a(v6, new com.ss.android.wenda.c.c(this.e, this.f))
                        .a(v7, new com.ss.android.wenda.c.c(this.e, this.f))
                        .a(com.ss.android.article.browser.R.id.abstract_layout, new com.ss.android.wenda.c.c(this.e, this.f))
                        .a(com.ss.android.article.browser.R.id.thumb_container, new d(this.e))
                        .a(com.ss.android.article.browser.R.id.digg_btn, new g(this.e, this.h))
                        .a(v8, new e(this.e, this.h)).a(com.ss.android.article.browser.R.id.section_title_tv, new b(this)).a(0, new com.ss.android.wenda.c.a(this.d, arg10));
                break;
            }
            case 1: {
                v0 = new com.ss.android.k.aa(android.support.design.a.b(arg11, R.layout.answer_list_item)).a(v4, new com.ss.android.wenda.c.c(this.e, this.f)).a(v6, new com.ss.android.wenda.c.c(this.e, this.f)).a(v7, new com.ss.android.wenda.c.c(this.e, this.f)).a(com.ss.android.article.browser.R.id.abstract_layout, new com.ss.android.wenda.c.c(this.e, this.f)).a(com.ss.android.article.browser.R.id.thumb_container, new d(this.e)).a(com.ss.android.article.browser.R.id.digg_btn, new g(this.e, this.h)).a(v8, new e(this.e, this.h)).a(0, new com.ss.android.wenda.c.a(this.d, arg10));
                break;
            }
            default: {
                v0 = null;
                break;
            }
        }

        return v0;
    }

    public final void a(int arg3, com.ss.android.k.aa arg4) {
        if(arg4 != null) {
            Object v0 = arg4.d.get(0);
            if((v0 instanceof com.ss.android.wenda.c.a)) {
                ((com.ss.android.wenda.c.a)v0).c = arg3;
            }

            super.a(arg3, arg4);
        }
    }

    static i b(com.ss.android.wenda.a.a arg1) {
        return arg1.f;
    }

    public final void b(int arg3, FeedViewHolder arg4) {
        if(arg4 != null) {
            Object v0 = this.getItem(arg3);
            if(v0 != null) {
                arg4.a(39, ((Answer)v0).mAnsId);
            }
        }
    }

    public final com.ss.android.action.b.b f() {
        if(this.a == null) {
            ImpressionHelper v1 = ImpressionHelper.getInstance();
            int v0 = 0;
            switch(this.e) {
                case 1: {
                    v0 = 15;
                    break;
                }
                case 2: {
                    v0 = 16;
                    break;
                }
            }

            this.a = v1.a(v0, this.g, null);
        }

        return this.a;
    }

    public final int getItemViewType(int arg3) {
        int v0 = 1;
        if(arg3 == 0 && this.e == 1) {
            v0 = 0;
        }

        return v0;
    }

    public final int getViewTypeCount() {
        return 2;
    }
}

